package com.yuyz.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.yuyz.service.HelloService;


@Service()
public class HelloServiceImpl implements HelloService {
    public String methodA() {
        // 获取0-100随机数
        int num = (int) (Math.random() * 100);
        try {
            // 睡眠
            Thread.sleep(num);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("methodA执行，本次睡眠" + num + "毫秒");
        return "methodA";
    }

    public String methodB() {
        // 获取0-100随机数
        int num = (int) (Math.random() * 100);
        try {
            // 睡眠
            Thread.sleep(num);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("methodB执行，本次睡眠" + num + "毫秒");
        return "methodB";
    }

    public String methodC() {
        // 获取0-100随机数
        int num = (int) (Math.random() * 100);
        try {
            // 睡眠
            Thread.sleep(num);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("methodC执行，本次睡眠" + num + "毫秒");
        return "methodC";
    }
}
